import random
n = random.randint(0,10)
i = 0
r = False
while r == False:
    c = eval(input('请输入所猜数字(0~10)'))
    i = i+1
    if c > n:
        print('遗憾，太大了')
    elif c < n :
        print('遗憾，太小了')
    elif c == n:
        print('恭喜你{}次猜中了'.format(i))
        r = True
